package com.quick.threadtest;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @ClassName ExecutorsSubmit
 * @Description 有返回值的线程池使用
 * @Author Wangxin
 * @Date 2019-03-02 22:29
 * @Version 1.0
 **/
public class ExecutorsSubmit {
    public static void main(String[] args) throws Exception{
        Callable<String> callable = ()->{
            return "sss";
        };
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        Future<String> future = executorService.submit(callable);
        System.out.println(future.get());
    }


}
